import request from '@/utils/request'

// 查询店铺商品列表
export function listShopGood (query) {
  return request({
    url: '/system/shopGood/list',
    method: 'get',
    params: query
  })
}

// 查询店铺商品详细
export function getShopGood (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/shopGood/getInfo',
    method: 'get',
    params: params
  })
}

// 新增店铺商品
export function addShopGood (data) {
  return request({
    url: '/system/shopGood/insert',
    method: 'post',
    data: data
  })
}

// 修改店铺商品
export function updateShopGood (data) {
  return request({
    url: '/system/shopGood/update',
    method: 'post',
    data: data
  })
}

// 删除店铺商品
export function delShopGood (id) {
  const params = {
    'id': id
  }
  return request({
    url: '/system/shopGood/delete',
    method: 'post',
    params: params
  })
}
// 批量删除店铺商品
export function delBatchShopGood (ids) {
  const params = {
    'ids': ids
  }
  return request({
    url: '/system/shopGood/deleteBatch',
    method: 'post',
    params: params
  })
}

// 导入店铺商品
export function importData (data) {
  return request({
    url: '/system/shopGood/importData',
    method: 'post',
    data: data
  })
}
